<template>
	<uni-nav-bar title="提货成功" left-icon="left" @clickLeft="navBack" :fixed="true" statusBar></uni-nav-bar>
	<view class="package column">
		<uni-icons type="checkbox-filled" size="50" color="#2C99FF"></uni-icons>
		<view class="title">提货成功</view>
		<view class="space-between shop"><view>商品名称</view><view>{{methodSetail.goods_name}}</view></view>
		<view class="space-between shop"><view>提货数量</view><view><text>x {{methodSetail.goods_nums}}</text></view></view>
		<view class="space-between shop"><view>提货方式</view><view>{{methodSetail.dispatch_name}}</view></view>
		<view class="space-between shop"><view>提货时间</view><view>{{methodSetail.createtime}}</view></view>
		<view class="space-between shop" v-if="type!='virtual'"><view>店家</view><view><text>{{methodSetail.store_name}}</text></view></view>
		<view class="space-between shop" v-if="type!='virtual'"><view>联系商家</view><view><text>{{methodSetail.store_realname}}</text>
		<text class="tel" @click="telCall(methodSetail.store_phone)">{{methodSetail.store_phone}}</text></view></view>
		<view class="space-between shop" v-if="type!='virtual'"><view>店铺地址</view><view class="loc">{{methodSetail.store_address}}</view></view>
	</view>
</template>

<script setup lang="ts">
	import {navBack} from '@/utils/navigator';
	import { onLoad } from '@dcloudio/uni-app';
	import { methodDetail } from '@/gql/group';
	import { telCall } from '@/utils/copyText';
	import { toPublish } from '@mqtt';
	import { ref,Ref } from 'vue';
	const methodSetail:Ref<any> = ref({});
	const orderID=ref('')
	const type=ref('')
	const storeId=ref('')
	onLoad((pearm)=>{
		orderID.value=pearm.id
		type.value=pearm.type
		storeId.value=pearm.storeId
		init()
	})
	function init(){
		const payload = {
		  query: methodDetail,
		  variables: { order_id:Number(orderID.value)},
		};
		toPublish('ql/store/getOrderHexiaoInfo', payload, (obj: any) => {
		  const { order_hexiao_info } = obj.data;
		  methodSetail.value=order_hexiao_info
		});
	}
</script>

<style scoped lang="less">
	.title{
		font-size: 40rpx;
		font-family: Source Han Sans CN;
		font-weight: 500;
		color: #333333;
	}
	.shop{
		width: 100%;
		margin-top:15rpx;
		view{
			font-size: 30rpx;
			font-family: Source Han Sans CN;
			font-weight: 400;
			color: #333333;
		}
		.tel{
			color:#2C99FF;
			margin-left: 10rpx;
		}
		.loc{
			width: 70%;
			text-align: right;
		}
	}
</style>